using System;
using System.Collections.Generic;
using System.Text;
using System.Reflection;

namespace Cephei
{
    /// <summary>
    /// Calculator objects implement this inteface for background recalculation.
    /// Func<> FastFunc<> Async<> & delegates have not been used because the interfaces
    /// change between versions, and all add an overhead
    /// </summary>
    /// <typeparam name="T">The type that is returned from the function call</typeparam>
    public interface IFormula<T>
    {
        /// <summary>
        /// Perform the calculation on the current thread
        /// </summary>
        /// <returns>value from calculation</returns>
        T Calculate ();

        /// <summary>
        /// If an empty cell has been replaced with a real value, all the calculators that are dependant on it
        /// need to be notified that they need to re-check that they are refering to the correct instance
        /// </summary>
        void Link();
    }
}
